<%@ WebService Language="C#" Class="PrinterProxy" %>

using System;
using System.Web.Services;
#if LINUX
using DBus;
#else
using System.ServiceModel;
#endif
using repragator;

[WebService (Namespace="http://bla.org/PrinterProxy")]
public class PrinterProxy : WebService
{
	private IPrinter printer;

	public PrinterProxy()
	{
	#if LINUX
		this.printer = Bus.Session.GetObject<Printer>("org.repragator.printer", new ObjectPath("/org/repragator/printer"));
	#else
		ChannelFactory<IPrinter> factory = new ChannelFactory<IPrinter>(new BasicHttpBinding(), new EndpointAddress("http://10.0.6.140:8081/Printer"));
	
		this.printer = factory.CreateChannel();
	#endif
	}

	[WebMethod]
	public bool Online()
	{
		return this.printer.Online;
	}
	
	[WebMethod]
	public void Move(string axis, double distance, int feedrate)
	{
		this.printer.Move(axis, distance, feedrate);
	}
}